#ifndef APPLYFRIENDPAGE_H
#define APPLYFRIENDPAGE_H

#include <QWidget>
#include<unordered_map>
#include<map>
#include"global.h"
#include"userdata.h"
#include"tcpmgr.h"
#include"usermgr.h"
#include"applyfrienditem.h"
namespace Ui {
class ApplyFriendPage;
}

class ApplyFriendPage : public QWidget
{
    Q_OBJECT

public:
    explicit ApplyFriendPage(QWidget *parent = nullptr);
    ~ApplyFriendPage();

    void AddNewApply(std::shared_ptr<AddFriendApply>apply);
protected:
    void paintEvent(QPaintEvent *event);
private:
    Ui::ApplyFriendPage *ui;
    void loadApplyList();
    std::unordered_map<int,ApplyFriendItem*>_unauth_items;

    std::vector<QString> strs = {
        "hello world!",
        "Great job on the presentation!",
        "Looking forward to the next update.",
        "Thanks for the helpful information.",
        "I appreciate your hard work on this.",
        "Can't wait to see what's next.",
        "Keep up the excellent work!",
        "I learned a lot from your post.",
        "Your insights are always valuable.",
        "The design is really impressive.",
        "I agree with your perspective on this issue.",
        "Your explanation made everything clear."
    };
    std::vector<QString> names = {
        "Wu",
        "Alice",
        "Bob",
        "Li",
        "David",
        "Zhang",
        "Eva",
        "Chen",
        "Frank",
        "Grace",
        "Liu"
    };
    std::vector<QString> heads = {
        ":/images/head_1.jpg",
        ":/images/head_2.jpg",
        ":/images/head_3.jpg",
        ":/images/head_4.jpg",
        ":/images/head_5.jpg",
        ":/images/head_6.jpg",
        ":/images/head_7.jpg",
        ":/images/head_8.jpg",
        ":/images/head_9.jpg",
        ":/images/head_12.jpg"
    };
public slots:
    void slot_auth_rsp(std::shared_ptr<AuthRsp>);
signals:
    void sig_show_search(bool);

};

#endif // APPLYFRIENDPAGE_H
